package myapp.com.myapplication;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

import java.util.ArrayList;
import java.util.List;

import myapp.com.myapplication.Adapter.BaseViewHolder;
import myapp.com.myapplication.Adapter.CommonAdapter;

public class MyAdapter2 extends CommonAdapter<String> {

    private List<String> list = new ArrayList<>();
    private Context context;

    public MyAdapter2(Context context, int itemLayoutId) {
        super(context, itemLayoutId);
        this.context = context;
        for (int i = 0; i < 10; i++) {
            list.add("1111");
        }
        super.setListData(list);
    }

    @Override
    public void convert(BaseViewHolder helper, String item) {
        ImageView iv = helper.getView(R.id.iv);
        String url = "http://reso.dalongyun.com/vsryun/yunadmin/android/5fabb3a91a695.jpg";
        Glide.with(context).load(url).into(iv);
    }
}
